home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / s_to_z / tpack / toolproc.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-09-15  |  1.0 KB  |  48 lines

  1. unit ToolProc;
  2. {application wide tool procedures}
  3. {used to link to dll's or use/link objects into the current project}
  4.  
  5. {the idea is to literally centralize calls for well defined stuff here.
  6. this makes it easier to use bound and unbound code by a compiler switch.}
  7.  
  8. interface
  9.  
  10. { Put this comment at the beginning of a line to use the DLL instead: $DEFINE USEDLL}
  11. {xx $DEFINE USEDLL}
  12. { Alternatively select Project Options|Directories/Conditionals and specify USEDLL there}
  13.  
  14. {There is a tiny dpr for tpDLL included.}
  15.  
  16. {$IFDEF USEDLL}
  17. uses
  18.   Forms, Shells;
  19.  
  20. {$ELSE}
  21. uses
  22.   Forms, About;
  23. {$ENDIF}
  24.  
  25. procedure AboutBox;
  26.  
  27. implementation
  28.  
  29. procedure AboutBox;
  30. begin
  31.   {$IFDEF USEDLL}
  32.     with TDLLShell.Create(Application) do try
  33.       Run('tpDLL','AboutBox');
  34.     finally
  35.       Free; {finally free == delphi !}
  36.       end
  37.   {$ELSE} {use the same code as the invocation in the dll.}
  38.     With TAboutBox.Create(Application) do try
  39.       Execute;
  40.     finally
  41.       Free;
  42.       end;
  43.   {$ENDIF}
  44. end;
  45.  
  46.  
  47. end.
  48.